//- Copyright (c) 2016 Lucky Byte, Inc.
extends ../table

block form_items
  .field.thirteen.wide
    if page_perms.new
      button.ui.right.floated.green.button(type="button"
        onclick="window.location = '/reports/new'") 新增报表
    else
      button.ui.right.floated.green.button.disabled(type="button")
        i.icon.ban
        | 新增报表

block thead
  tr
    th.center.aligned
    th.center.aligned 序号
    th.center.aligned 名 称
    th.center.aligned 处理器
    th.center.aligned 模板文件
    th.center.aligned 备 注
    th.center.aligned

block tbody
  each record, index in records
    - var tr_class = record.master ? 'positive' : ''
    tr(class="#{tr_class}")
      td.center.aligned.collapsing
        i.icon.pdf
      td.center.aligned.collapsing
        if page_perms.edit || page_perms.disable
          a(href="/reports/edit/#{record.serial}")= record.serial
        else
          = record.serial
      td.center.aligned.collapsing= record.name
      td.center.aligned.collapsing= record.ipaddr
      td.center.aligned.collapsing
      td= record.notes
      td.center.aligned.collapsing
